
/**工具模块 */
module GameUtil {
	/**
 * 玩家信息--郭启航
 * 
*/
	export class PlayerMessage {
		private constructor() {
			this.initialize();
		}

		/**是否是单人模式 */
		public onePerson: boolean;
		/**基础飞机数量*/
		public PlaneNum: number;

		/**AI购买的数组 */
		public AiPlane: any[];
		/**Ai防御数组(string)*/
		public Aidefense: any[];
		/**Ai防御数组(飞机)*/
		public AidefenseFly: any[];
		/**Ai难度*/
		public AIdifficulty: number;

		/**服务器飞机配置文件 */
		public serverPlaneConfig: any[];
		/**本地飞机配置文件 */
		public clientPlaneConfig: any[];
		/**敌机配置文件 */
		public planeConfig: any[];
		/**子弹配置文件*/
		public bulletConfig: any[];

		/**玩家发送敌机列表 */
		public sendEnemy: number[];
		/**玩家接受敌机列表 */
		public getEnemy: number[];

		/**飞机总数 */
		public AllPlaneCount: number;

		/**己方溜掉的飞机*/
		public Game2addEnemy: number[];
		/**敌方漏的飞机 */
		public EneMissList: number[];
		/**己方基地 正在攻击*/
		public is_myTurryAtk: boolean;
		/**敌方基地 正在攻击*/
		public is_emyTurryAtk: boolean;
		/**空战飞机出发点 */
		public airBattlePosition: any[];
		/**己方防守飞机出发点 */
		public defensePosition: any[];
		/**敌方防守飞机出发点 */
		public enemyDefensePosition: any[];

		/**地方基地血量*/
		public enemyHomeHp: number;
		/**购买敌机总量限制*/
		public limitToBuyEnemy: number;
		/**基地血量*/
		public BaseHp: number;
		/**基地位置*/
		public HomePoint: egret.Point;
		/**基地角度*/
		public HomeAngle: number;
		/**基地子弹攻击力*/
		public HomeAtk: number;
		/**基地护盾是否存在*/
		public HomeShield: boolean;
		/**必杀Bool*/
		public HomeSlay: boolean;
		/**玩家单例 */
		public static instance: PlayerMessage;
		/**玩家金币数 */
		public money: number;
		/**准备计时*/
		public time: number;
		/**玩家投资费用 */
		public investment: number;
		/**玩家血量*/
		public playHp: number;
		/**玩家飞机位置 */
		public player_position: egret.Point;
		/**是否存在加速飞机 */
		public hasSpeedAdd: boolean;
		/**摇杆移动方向 */
		public joystick_direction: egret.Point;
		/**游戏波次 */
		public game_turns: number;

		/**是否购买了僚机 */
		public isBuyGuard: boolean;
		/**僚机配置文件 */
		public Guard_PlaneConfig: any[];
		/**是否购买环绕僚机 */
		public isBuyAroundPlane: boolean;
		/**是否购买跟随 僚机*/
		public isBuyFollowPlane: boolean;

		/**游戏是否结束 */
		public isGameOver: boolean;
		/**是否在战斗 */
		public isFight: boolean;
		/**是否准备 */
		public isReady: boolean;
		/**连接模式下对方是否已准备进入下一回合 */
		public enemyToNext: boolean;
		/**Ai资金*/
		public AiMoney: number;
		/**对方是否离线状态 */
		public isLeave: boolean;


		/**玩家信息初始化 */
		public initialize() {
			this.onePerson = true;
			this.PlaneNum = 20;
			this.AiMoney = 0;
			this.AiPlane = [];
			this.Aidefense = [];
			this.AidefenseFly = [];
			//this.AIdifficulty = 0;


			this.planeConfig = [];
			if (this.bulletConfig == null)
				this.bulletConfig = [];
			if (this.serverPlaneConfig == null) {
				this.serverPlaneConfig = [];
			}
			if (this.clientPlaneConfig == null) {
				this.clientPlaneConfig = [];
			}

			this.sendEnemy = [];
			this.getEnemy = [];
			this.AllPlaneCount = 20;
			this.Game2addEnemy = [];
			this.EneMissList = [];

			this.is_myTurryAtk = false;
			this.is_emyTurryAtk = false;

			this.airBattlePosition = [];
			this.defensePosition = [];
			this.enemyDefensePosition = [];

			
            Fighter.Defense.startCreatPlane = false;
            Fighter.EnemyDefense.startCreatePlane = false;

			this.limitToBuyEnemy = 10000;
			this.BaseHp = 10;
			this.enemyHomeHp = 10;
			this.HomePoint = new egret.Point(320, 1090);
			this.HomeAngle = 0;
			this.HomeAtk = 1;
			this.HomeShield = false;
			this.HomeSlay = false;
			this.money = 0;
			this.time = 90;
			this.investment = 0;
			this.playHp = 4;
			this.player_position = new egret.Point(320, 1000);

			this.hasSpeedAdd = false;

			this.joystick_direction = new egret.Point();

			this.game_turns = 1;

			this.isBuyGuard = false;
			if (this.Guard_PlaneConfig == null)
				this.Guard_PlaneConfig = [];
			this.isBuyAroundPlane = false;
			this.isBuyFollowPlane = false;

			this.isGameOver = false;
			this.isFight = false;
			this.isReady = false;
			this.enemyToNext = false;

			//this.isLeave=false;
		}
		/**静态单例构造方法 */
		public static createMsg(): PlayerMessage {

			if (PlayerMessage.instance == null) {
				PlayerMessage.instance = new PlayerMessage();
			}
			return PlayerMessage.instance;
		}
	}
}